<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    我是第三页
    <button>回退</button>
</body>
</html>
<script>
    let btn=document.querySelector('button')
    btn.onclick=function(){
        history.go(-2)
    }
</script>